{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "2dd6cc1c",
   "metadata": {},
   "outputs": [],
   "source": [
    "stu_id = [10000,10001,10002,10003,10004,10005,10006,10007,10008,10009,10001,10001]\n",
    "# 如何取出所有位置的10001的index\n",
    "for i in stu_id:\n",
    "    #循环遍历stu_id的所有内容\n",
    "    if i == 10001:\n",
    "        # 判断如果元素为10001的时候，怎么取出索引值？\n",
    "        print(stu_id.index(i))\n",
    "        ##??、？、？？、？？？\n",
    "\n",
    "# 枚举:因为list其实不仅有values值，还有index索引，但for循环主要循环遍历其值，不编历索引\n",
    "#所以有了这个方法,遍历两值\n",
    "\n",
    "#enumerate()\n",
    "pop_list = [] # append方法经常用于新建列表\n",
    "for index,item in enumerate(stu_id):\n",
    "    # print(index,item)\n",
    "    if item == 10001:\n",
    "    pop_values_list.append(index)\n",
    "print(\"我们想要删除pop的值:\",pop_value_list)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
